<script type="text/javascript">
//页面加载时执行
$(function(){
	$.post("inventorymanagement/getUserAndBanch",function(json){
		var activeUser = json.activeUser;
		var userNo=activeUser.userNo;
		var branchNo=activeUser.branchNo;
		$("input[name='empNoByBatchReceived']").val(userNo);
		$("input[name='branchNoByEmpBatchReceived']").val(branchNo);	
    });
	
	$.get("applicationSingle/getCardInfo",function(data){
		var contentb="<option value=''>请选择</option>";
		var contenta="<option value=''>请选择</option>";
		var i;
		$(data).each(function(n,item){
			var cardTypeCode = item.cardTypeCode;
			var cardCode = item.cardCode;		
			for(i=0;i<item.cdPhysicsTypes.length;i++){
				if(item.cdPhysicsTypes[i].cardTypeCode==cardTypeCode){
					contenta+="<option value="+item.cdPhysicsTypes[i].cardTypeCode+" selected>"
					+item.cdPhysicsTypes[i].cardTypeName+"</option>"
				}else{
					contenta+="<option value="+item.cdPhysicsTypes[i].cardTypeCode+">"
					+item.cdPhysicsTypes[i].cardTypeName+"</option>"
				}
				
			};
			for(i=0;i<item.cdProDefinitions.length;i++){
				if(item.cdProDefinitions[i].cardpCode==cardCode){
					contentb+="<option value="+item.cdProDefinitions[i].cardpCode+" selected>"
					+item.cdProDefinitions[i].cardpName+"</option>"
				}else{
					contentb+="<option value="+item.cdProDefinitions[i].cardpCode+">"
					+item.cdProDefinitions[i].cardpName+"</option>"
				}
				
			}
			$("#cardTypeByEmpReceiveCard").html(contenta);
			$("#cardCodeByEmpReceiveCard").html(contentb);		
			
		});
		var formData = $("#form").serialize();
		formData = decodeURIComponent(formData,true);
		$.post("inventoryMagOfBatchRequiredByEmp/queryBatchApplyRecords",formData,queryBatchApplyRecords,"json");
	},"json");	
	
	
})

function dialog(){
	//提交前线判断是否有选项选中
	var checkItems = $("input[name='empReceivedInfoChecked']:checked");
	if(checkItems.length<1){
		alertMsg.warn("未选择数据！");
		return false;
	}
    var str=prompt("员工信息","请输入您的工号……");
    while(!/^[1-9][0-9]{5}$/.test(str)){
    	str=prompt("员工编号为6位数字","请输入……");
    }
    if(str){
        //这里需要验证该员工是否是该网点
        
        
    }
  	//重新包装并提交信息。影藏的input框
    if(true){
    	$("input[name='receiveEmpNoByInventory']").val(str);
    }
}
</script>
<div class="pageHeader">
	<form id="form" method="post" action="inventoryMagOfBatchRequiredByEmp/queryBatchApplyRecords" class="pageForm"
		onsubmit="return validateCallback(this,queryBatchApplyRecords);">
		<input name="serilizeData" type="hidden"/>
		<div class="searchBar">
			<div class="row" style="padding: 0 10px;">
				<!-- <div class="col-md-4 col-sm-12">
					<p>
						<label>领用分类：</label> 
							<select id="receiveClassifyByEmpReceiveCard"
								name="receiveClassifyByEmpReceiveCard" class="validRequired">
								<option value="0">请选择</option>
								<option value="2">不记名预制卡</option>
								<option value="3">记名批量预制卡</option>
							</select>
					</p>
				</div> -->
				<div class="col-md-4 col-sm-12">
					<p>
						<label>卡产品：</label> <select id="cardCodeByEmpReceiveCard" name="cardCodeByEmpReceiveCard"
							name="cardPCode">
						</select>
					</p>
				</div>
				<div class="col-md-4 col-sm-12">
					<p>
						<label>卡类型：</label> <select id="cardTypeByEmpReceiveCard" name="cardTypeByEmpReceiveCard">
						</select>
					</p>
				</div>
				<div class="col-md-4 col-sm-12">
					<p>
						<label>网点编号：</label> 
						<input id="branchNoByEmpBatchReceived" name="branchNoByEmpBatchReceived" value="" readonly="readonly"/>
					</p>
				</div>
			</div>
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-4 col-sm-12">
					<p>
						<label>申请日期(起)：</label> 
						<input id="applyDateStartByEmpReceived" name="applyDateStartByEmpReceived" class="date validDateFrom"/>
					</p>
				</div>
				<div class="col-md-4 col-sm-12">
					<p>
						<label>申请日期(止)：</label> 
						<input id="applyDateEndByEmpReceived" name="applyDateEndByEmpReceived" class="date validDateTo"/>
					</p>
				</div>
				<div class="col-md-4 col-sm-12">
					<p>
						<label>员工号：</label> 
						<input id="empNoByBatchReceived" name="empNoByBatchReceived"  readonly="readonly"/>
					</p>
				</div>
			</div>
			<div class="row" style="padding: 0 10px;">
				<div class="col-md-4 col-sm-12">
					<p>
						<label>申请单位：</label> 
						<input id="corpNameByEmpReceived" name="corpNameByEmpReceived"/>
					</p>
				</div>
				<div class="col-md-4 col-sm-12">

				</div>
				<div class="col-md-4 col-sm-12">

				</div>
			</div>
			<div class="subBar">
				<ul>
					<li>
						<div class="buttonActive">
							<div class="buttonContent">
								<button type="submit" id="queryBatchApplyRecord" >查询</button>
							</div>
						</div>
					</li>
				</ul>
			</div>
		</div>
	</form>
</div>

<form method="post" action="inventoryMagOfBatchRequiredByEmp/receiveByEmpRegister" class="pageForm"
	onsubmit="return validateCallback(this,printViewPageAjaxDone);">
	<input name="receiveEmpNoByInventory" value='' type="hidden"/>
	<div class="pageContent">
		<div id="ByQueryBatchApplyRecords">
			<table class="table" width="960" layoutH="218">
				<thead>
					<tr align="center">
						<th width="2%"><input type="checkbox" id="ids" name="tasking" group="empReceivedInfoChecked" class="checkboxCtrl"></th>
						<th width="2%">序号</th>
						<th width="5%">卡产品</th>
						<th width="5%">卡类型</th>
						<th width="7%">申请单位</th>
						<th width="7%">申请日期</th>
						<th width="2%">数量</th>
						<th width="7%">任务号</th>
					</tr>
				</thead>
				<tbody id="tbodyqueryBatchApplyRecords">

				</tbody>
			</table>
		</div>
		<!--  <div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select id="numPerPageByQueryCardInfo" name="numPerPage" onchange="paging(this,$('#queryCard'),queryCard)">
				<option value="20">20</option>
				<option value="30">30</option>
				<option value="50">50</option>
				<option value="100">100</option>
			</select>
			<span id="totalCountByQueryCardInfo" ></span>
		</div>
			<div id="paginationByQueryCardInfo" class="pagination1"  ></div>
	</div> -->
		<!-- <div class="panelBar">
			<div class="pages">
				<span>显示</span> <select class="combox" name="numPerPage"
					onchange="navTabPageBreak({numPerPage:this.value},'tbodyByQueryCardInfo',queryCard)">
					<option value="20">20</option>
					<option value="50">50</option>
					<option value="100">100</option>
					<option value="200">200</option>
				</select> <span id="totalCountByQueryCardInfo">条，共${totalCount}条</span>
			</div>

			<div callback='queryCard' id="paginationByQueryCardInfo"
				rel="tbodyByQueryCardInfo" class="pagination" targetType="navTab"
				totalCount="200" numPerPage="5" pageNumShown="5" currentPage="1"></div>

		</div> -->
	</div>
	<div class="formBar">
			<ul> 
				<li>
				<div class="buttonActive" ><div class="buttonContent" ><button id="" onclick="return dialog(this);" type="submit">提交</button></div></div>
				</li>
				<!-- <li>
				<div class="buttonActive" ><div class="buttonContent" ><button id="subTask" onclick="return validateChechBox();" type="submit">关闭</button></div></div>
				</li> -->
				
			</ul>
		</div>
	</div>
</form>


